﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<cludg.Web.ViewModels.OfferModel>" %>
<%@ Import Namespace="cludg.Web.Core.Captcha" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Предложить историю
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<h2>
		Предложить историю</h2>
	<% Html.EnableClientValidation(); %>
	<% using (Html.BeginForm("Add", "Offer", FormMethod.Post , new Dictionary<string, object> { { "enctype", "multipart/form-data" } }))
	{%>
	<%: Html.ValidationSummary(true) %>
	<fieldset>
		<div class="editor-label">
			<%: Html.LabelFor(model => model.ImageContentUrl) %>
		</div>
		<div class="editor-field">
			<%: Html.TextBoxFor(model => model.ImageContentUrl)%>
			<%: Html.ValidationMessageFor(model => model.ImageContentUrl)%>
		</div>
		<div class="editor-label">
			<label>...или загрузить</label>
		</div>
		<div>
			<input type="file" id="fileUpload" name="<%: Model.ImageUploadFileName %>"/>
		</div>

		<div class="editor-label">
			<%: Html.LabelFor(model => model.Comment) %>
		</div>
		<div class="editor-field">
			<%: Html.TextBoxFor(model => model.Comment) %>
			<%: Html.ValidationMessageFor(model => model.Comment) %>
		</div>

		<div class="editor-label">
			<%: Html.LabelFor(model => model.Title) %>
		</div>
		<div class="editor-field">
			<%: Html.TextBoxFor(model => model.Title) %>
			<%: Html.ValidationMessageFor(model => model.Title) %>
		</div>

	<% if (Model.SecurityInfo.IsAnonymouse)
	{%>
		<div class="editor-label">
			<%: Html.LabelFor(model => model.AnonymouseAuthorName)%>
		</div>
		<div class="editor-field">
			<%: Html.TextBoxFor(model => model.AnonymouseAuthorName)%>
			<%: Html.ValidationMessageFor(model => model.AnonymouseAuthorName)%>
		</div>
	<% } %>

		<%: Html.AddCaptchaFields("Введите слова на картинке") %>

		<p>
			<input type="submit" value="добавить" />
		</p>
	</fieldset>
	<% } %>
	<div>
		<%: Html.ActionLink("На главную", "Index", "Home") %>
	</div>
</asp:Content>
